700) { $thumb->resizePercent(50); } elseif($width > 600) { $thumb->resizePercent(60); } elseif($width > 500) { $thumb->resizePercent(70); } elseif($width > 400) { $thumb->resizePercent(80); } else { $thumb->resizePercent(100); } $thumb->show(); } elseif ($ext == 'gif') { //画像の作成 $img = imagecreatefromgif($setstring); $width = ImageSX($img); imagedestroy($img); //画像の作成 $thumb = PhpThumbFactory::create($setstring); if ($width > 700) { $thumb->resizePercent(50); } elseif($width > 600) { $thumb->resizePercent(60); } elseif($width > 500) { $thumb->resizePercent(70); } elseif($width > 400) { $thumb->resizePercent(90); } else { $thumb->resizePercent(100); } $thumb->show(); //jpg gif png 以外はjpgに変換 } elseif ($ext == 'png') { //画像の作成 $img = imagecreatefrompng($setstring); $width = ImageSX($img); imagedestroy($img); //画像の作成 $thumb = PhpThumbFactory::create($setstring); if ($width > 700) { $thumb->resizePercent(50); } elseif($width > 600) { $thumb->resizePercent(60); } elseif($width > 500) { $thumb->resizePercent(70); } elseif($width > 400) { $thumb->resizePercent(90); } else { $thumb->resizePercent(100); } $thumb->show(); } else { //echo "http://www.youtube.com/v/CdfjqM4ynMc&hl=ja"; } ?>